package com.zzq.demo.cron.handler;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

/**
 * @author : zhaoziqian
 * @description :
 * @date : 2019/8/1 17:35
 */
@Slf4j
@JobHandler(value="paramJobHandler")
@Component
public class ParamJobHandler extends IJobHandler {

    @Override
    public ReturnT<String> execute(String param) throws Exception {
        log.info("ParamJobHandler 开始执行");
        XxlJobLogger.log("ParamJobHandler 开始执行");
        if (StringUtils.isNotEmpty(param)) {
            for (String arg :  param.split(",")) {
                XxlJobLogger.log(arg);
                log.info(arg);
            }
        }
        return new ReturnT<>(ReturnT.SUCCESS_CODE,"1222222222222222222222");
    }
}
